import { useHistory } from 'react-router';

export const useChatRouter = () => {
  const history = useHistory();

  const goToChat = (chatId: string) => {
    history.replace({
      pathname: `/chat/${chatId}`,
    });
  };

  return goToChat;
};
